package com.ysd.lis.controller.sys;


import com.ysd.common.Result;
import com.ysd.common.dto.OrganizationDTO;
import com.ysd.lis.annotation.LogDetail;
import com.ysd.lis.aspect.OperationType;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.SysParam;
import com.ysd.lis.request.SysParamParam;
import com.ysd.lis.service.SysParamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 员工表
 * 前端控制器
 * </p>
 *
 * @author prs
 * @since 2023-10-19
 */
@Api(tags = "系统参数")
@RestController
@RequestMapping("/api/sys/sysParam")
public class SysParamController extends BaseController {

    @Autowired
    SysParamService sysParamService;
    @ApiOperation("分页查询")
    @GetMapping("/findSysParamList")
    public Result findSysParamList(SysParamParam param){
        return sysParamService.findSysParamList(param);
    }
    @ApiOperation("新增")
    @PostMapping("/addSysParam")
    @LogDetail(requestParam ="addSysParam",operationType = OperationType.INSERT, module = "新增系统参数",content = "通过系统参数设置模块，增加【name】参数", businessName = "name")
    public Result addSysParam(@RequestBody SysParam param){
        return  sysParamService.addSysParam(param);
    }

    @ApiOperation("修改")
    @PostMapping("/editSysParam")
    @LogDetail(requestParam ="editSysParam",operationType = OperationType.UPDATE, module = "修改系统参数",content = "通过系统参数设置模块，编辑【name】参数", businessName = "name")
    public Result editSysParam(@RequestBody SysParam param) {
        return sysParamService.editSysParam(param);
    }

    @ApiOperation("根据详情id删除详情数据")
    @PostMapping("/deleteSysParam")
    @LogDetail(requestParam ="deleteSysParam",operationType = OperationType.DELETE, module = "删除系统参数",content = "通过系统参数设置模块，删除【name】参数", businessName = "name")
    public Result deleteSysParam(@RequestBody SysParam param) {
        return sysParamService.deleteSysParam(param);
    }

    @ApiOperation("根据orgid复制系统参数")
    @PostMapping("/copySysParamByOrgId")
    public Result copySysParamByOrgId(@RequestBody OrganizationDTO param) {
        return sysParamService.copySysParamByOrgId(param);
    }


}
